<template>
  <view class="my-search-container" :style="{'background-color':bgcolor}" @click="handleSearch">
    <view class="my-search-box" :style="{'border-radius':radius+'px'}">
      <uni-icons type="search" size="17"></uni-icons>
      <text class="placeholder">搜索</text>
    </view>
  </view>
</template>

<script>
  export default {
    name:"my-search",
    props:{
      bgcolor:{
        type:String,
        default:'#c00000'
      },
      radius:{
        type:Number,
        default:20
      }
    },
    data() {
      return {
        
      };
    },
    methods:{
      handleSearch(){
        console.log(11);
        this.$emit('myclick')
        uni.navigateTo({
          url:'/subpkg/search/search'
        })
      }
    }
  }
</script>

<style lang="scss">
  .my-search-container{
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100rpx;
    .my-search-box{
      display: flex;
      align-items: center;
      justify-content: center;
      height: 70rpx;
      width: 90%;
      background-color: #fff;
      .placeholder{
       font-size: 15px;
      margin-left: 5px;
      }
    }
  }
</style>